package com.dcs.cn.item.enums;

public enum ItemStatus {
    NORMAL(1, "正常"),
    OFF_SHELF(2, "下架"),
    DELETED(3, "删除");

    private Integer code;
    private String message;

    ItemStatus(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
    public static ItemStatus getByCode(Integer code) {
        for (ItemStatus itemStatus : ItemStatus.values()) {
            if (itemStatus.getCode().equals(code)) {
                return itemStatus;
            }
        }
        return null;
    }
}
